package com.hyl.ssm.service;

import com.hyl.ssm.entity.Order;
import com.hyl.ssm.entity.Role;
import com.hyl.ssm.mapper.OrderMapper;
import com.hyl.ssm.mapper.RoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * RoleServiceImpl
 *
 * @author hyl
 * @date 2024-12-16
 */
@Service
public class RoleServiceImpl implements RoleService{

    @Autowired
    private RoleMapper roleMapper;

    public void setRoleMapper(RoleMapper roleMapper) {
        this.roleMapper = roleMapper;
    }

    @Override
    public Role selectRoleById(Integer id) {
        return null;
    }

    @Override
    public int insetRole(Role role) {
        for(int i=0;i<10;i++) {
            if(i==3){
                throw  new RuntimeException();
            }
            roleMapper.insetRole(role);
        }
        return 0;
    }

    @Override
    public int update(Role role) {
        return 0;
    }

    @Override
    public int delete(long id) {
        return 0;
    }
}
